<%@ page contentType="text/html; charset=ISO-8859-1" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Sistema de notificaci&oacute;n de Pagos a Proveedores JDE - FCC Construcci&oacute;n de CA, S.A</title>
<style type="text/css">
.textfield
{
	width:120px;
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
}
.textfield_no_editable
{
	width:120px;
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
	background-color:#DFDFDF;
}
.bordes
{
	border:1px solid #000;
	border-collapse:collapse;
}
</style>
<!--MENU-->
<link rel="stylesheet" href="/jde/scripts/menu/menu-bar.css" media="screen" type="text/css">
<script type="text/javascript" src="/jde/scripts/menu/menu-for-applications.js"></script>
<link rel="stylesheet" href="/jde/scripts/menu/menu-item.css" media="screen" type="text/css">
<!--DIALOGO-->
<link type="text/css" href="/jde/scripts/ui/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="/jde/scripts/ui/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.resizable.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="script.js"></script>
<script language="javascript" type="text/javascript">
window.onload = function()
{
	Reloj();
	var menuModel = new DHTMLSuite.menuModel();
	menuModel.addItemsFromMarkup('menuModel');
	menuModel.setMainMenuGroupWidth(00);
	menuModel.init();
	var menuBar = new DHTMLSuite.menuBar();
	menuBar.addMenuItems(menuModel);
	menuBar.setTarget('menu');
	menuBar.init();
	//LIMPIAR FORMULARIO
	document.getElementById('form1').reset();
	<%
	  //AGREGAR OTRO AUTORIZANTE
	  if (request.getParameter("pais") != null)
	  {
		  String pais = request.getParameter("pais");
		  out.write("document.getElementById('pais').value = \""+pais+"\";"+"\n");
	  }
	%>
	ComprobarPermiso();
	$("#procesando").dialog('close');
};

function Reloj()
{
	var fecha = new Date ();
  	var hora = fecha.getHours ( );
  	var minuto = fecha.getMinutes ( );
  	var segundo = fecha.getSeconds ( );
  	minuto = (minuto < 10 ? "0" : "") + minuto;
  	segundo = (segundo < 10 ? "0" : "") + segundo;
  	var tiempo = (hora < 12 ) ? "A.M" : "P.M";
  	hora = (hora > 12) ? hora - 12 : hora;
  	hora = (hora == 0) ? 12 : hora;
  	var cadena_hora = hora + ":" + minuto + ":" + segundo + " " + tiempo;
  	document.getElementById("reloj").innerHTML = "<b>"+cadena_hora+"</b>";
	setTimeout("Reloj()",1000);
}
</script>
</head>
<body style="font-family:Verdana, Geneva, sans-serif; font-size:11px;">
<jsp:useBean id="db" class="db.Conexion" scope="session"/>
<%
//COMPROBAR CONEXION
if ((db.ObtenerEstadoSQLServer().equals("desconectado"))||(db.ObtenerEstadoSQLServer() == null))
{
	out.write("<script language=\"javascript\" type=\"text/javascript\">"+"\n"+
	"<!--"+"\n"+
	"window.location=\"/jde/Pagos/?sesion_finalizada=ok\""+"\n"+
	"-->"+"\n"+
	"</script>");
}
else
{
	java.sql.Connection conex = db.ObtenerConexionSQLServer();
	if (conex.isClosed() == false)
	{
%>
<jsp:include page="/Pagos/home/top.jsp"/>
<div id="atencion" title="Atenci&oacute;n"></div>
<div id="confirmacion" title="Confirmaci&oacute;n"></div>
<div id="procesando" title="Procesando"></div>
<div id="registros" title="Registros"></div>
<div style="width:100%;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td width="100%" align="left">DATOS DE LA SESI&Oacute;N (<%=db.ObtenerUsuarioFull()%>, Hora: <span id="reloj"></span>)</td>
</tr>
</table>
</div>
<div id="todo" style="background-image:url(/jde/img/logo_fondo.png); height:250px; background-repeat:no-repeat; background-position:center;">
	<div style="text-align:center; font-weight:bold; background-color:#99ffcc; border:1px solid #666; padding:4px 4px 4px 3px;">CREACI&Oacute;N DE USUARIO DEL SISTEMA
	</div>
	<div style="margin-bottom:5px; border:1px solid #666; padding:4px 4px 4px 3px; text-align:center;">
	<a href="javascript:Evaluar();" class="menu_top">
	<img src="/jde/img/guardar.png" alt="Guardar" width="24" height="24" border="0" align="absmiddle" />&nbsp;Guardar
	</a>&nbsp;
	<a href="javascript:LimpiarFormulario();" class="menu_top">
	<img src="/jde/img/limpiar.png" alt="Limpiar formulario" width="24" height="24" border="0" align="absmiddle" />&nbsp;Limpiar formulario
	</a>&nbsp;
	<a href="javascript:Cancelar();" class="menu_top">
	<img src="/jde/img/cancelar.png" alt="Cancelar" width="24" height="24" border="0" align="absmiddle" />&nbsp;Cancelar
	</a>
	</div>
	<div id="evaluacion" style="text-align:center;">
	</div>
	<form id="form1" action="/jde/Pagos/Formularios/AgregarUsuario" method="post">
	<input type="hidden" id="fila" name="fila" />
      	<table border="0" cellspacing="2" cellpadding="0" align="center">
        <tr>
	        <td align="right" valign="top">Pa&iacute;s:</td>
          	<td align="left" valign="top"><input name="pais" type="text" class="textfield_no_editable" id="pais" readonly="readonly" onmouseover="ToolTip(this);"/>
            	<a href="javascript:CargarPaises();"><img src="/jde/img/buscar.png" alt="Buscar" width="18" height="18" border="0" align="absmiddle" /></a></td>
          	<td align="right" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;Acceso a las Compa&ntilde;&iacute;as:</td>
          	<td align="left" valign="top" rowspan="4">
		<select id="companias" name="companias" class="textfield" multiple="true" size="6" style="width:350px;"></select>
		</td>
		<td align="left" valign="top">&nbsp;&nbsp;
		<a href="javascript:CargarCompanias();"><img src="/jde/img/buscar.png" alt="Buscar" width="16" height="16" border="0" align="absmiddle" /></a></td>
		<td align="left" valign="top">&nbsp;&nbsp;
		<a href="javascript:EliminarCompania();"><img src="/jde/img/cerrar_aplicacion.png" alt="Eliminar" width="16" height="16" border="0" align="absmiddle" /></a></td>
        </tr>
        <tr>
          	<td align="right">Nombre real:</td>
          	<td align="left"><input name="nombre" type="text" class="textfield" id="nombre" onmouseover="ToolTip(this);"/></td>
        </tr>
	<tr>
		<td align="right">Nombre usuario:</td>
          	<td align="left"><input name="usuario" type="text" class="textfield" id="usuario" onblur="ComprobarUsuario();" onmouseover="ToolTip(this);"/></td>
	</tr>
	<tr>
		<td align="right">E-mail:</td>
          	<td align="left"><input name="mail" type="text" class="textfield" id="mail" onmouseover="ToolTip(this);"/></td>
	</tr>
	<tr>
		<td align="right">Contrase&ntilde;a:</td>
          	<td align="left"><input name="password" type="text" class="textfield" id="password" /></td>
		<td align="right">Todas las Compa&ntilde;&iacute;as</td>
          	<td align="left"><input type="checkbox" name="todas_companias" id="todas_companias" onclick="TodasCompanias();"/></td>
	</tr>
        <tr>
          	<td colspan="3" align="right">&iquest;Debe cambiar de contrase&ntilde;a al inciar sesi&oacute;n por primera vez?:</td>
          	<td align="left"><input type="checkbox" name="cambio_password" id="cambio_password" /></td>
        </tr>
	<tr>
          	<td colspan="3" align="right">&iquest;Es usuario administrador?:</td>
          	<td align="left"><input type="checkbox" name="usuario_administrador" id="usuario_administrador" /></td>
        </tr>
      </table>
      </form>
</div>
<%
	}
	else
	{
		out.write("<script language=\"javascript\" type=\"text/javascript\">"+"\n"+
		"<!--"+"\n"+
		"window.location=\"/jde/Pagos/?sesion_finalizada=ok\""+"\n"+
		"-->"+"\n"+
		"</script>");
	}
}
%>
</body>
</html>